﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'SearchMantenimiento')
	BEGIN
		DROP  Procedure  SearchMantenimiento
	END

GO

CREATE Procedure SearchMantenimiento

	(
		@nroPlaca nvarchar(10)
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	M.[Descripcion],
	M.[Estado],
	M.[FechaEntrega],
	M.[FechaIngreso],
	M.[IdBien],
	M.[IdMantenimiento]
	FROM [Mantenimiento] AS M
	INNER JOIN [Vehiculo] AS V ON M.[IdBien] = V.[IdBien]
	WHERE V.[NroPlaca] LIKE (@nroPlaca + N'%')
	
	SET NOCOUNT OFF
END

GO


GRANT EXEC ON SearchMantenimiento TO PUBLIC

GO

